﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="BuscarArquivosDeAudio.aspx.cs" Inherits="BuscarArquivosDeAudio" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div class="demoheading" style="width:400px">
        <br />
        Buscar Arquivos de Audio</div>
    <div class="collapsePanelHeader" style="width: 400px; height: 15px"></div>
    <table style="width: 400px" class="divDados">
        <tr>
            <td style="width: 83px">
                <asp:Label ID="lbNome" runat="server" Text="Nome"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="tbNome" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td style="width: 83px">
                <asp:Label ID="lbGenero" runat="server" Text="Gênero"></asp:Label>
            </td>
            <td>
                <asp:DropDownList ID="ddGenero" runat="server" AppendDataBoundItems="True" 
                    DataSourceID="odsGenero" DataTextField="Nome" DataValueField="Codigo">
                    <asp:ListItem Selected="True" Value="0">Selecione um Gênero</asp:ListItem>
                </asp:DropDownList>
                <asp:ObjectDataSource ID="odsGenero" runat="server" 
                    DataObjectTypeName="Negocios.Genero" DeleteMethod="Remover" 
                    InsertMethod="Inserir" OldValuesParameterFormatString="original_{0}" 
                    SelectMethod="ConsultarTodos" TypeName="Negocios.GeneroBLL" 
                    UpdateMethod="Atualizar"></asp:ObjectDataSource>
            </td>
        </tr>
        <tr>
            <td style="width: 83px">
                <asp:Label ID="lbAutor" runat="server" Text="Autor"></asp:Label>
            </td>
            <td>
                <asp:DropDownList ID="ddAutor" runat="server" 
                    DataSourceID="odsAutor" DataTextField="Nome" 
                    DataValueField="Codigo" style="margin-top: 0px" 
                    AppendDataBoundItems="True">
                    <asp:ListItem Value="0">Selecione um Autor</asp:ListItem>
                </asp:DropDownList>
                <asp:ObjectDataSource ID="odsAutor" runat="server" 
                    DataObjectTypeName="Negocios.Autor" DeleteMethod="Remove" InsertMethod="Insere" 
                    OldValuesParameterFormatString="original_{0}" SelectMethod="ConsultaTodos" 
                    TypeName="Negocios.AutorBLL" UpdateMethod="Atualiza"></asp:ObjectDataSource>
            </td>
        </tr>
        <tr>
            <td style="width: 83px">
                <asp:Label ID="lbAubum" runat="server" Text="Album"></asp:Label>
            </td>
            <td>
                <asp:DropDownList ID="ddAubum" runat="server" 
                    DataSourceID="odsAlbum" DataTextField="Nome" DataValueField="Cod" 
                    AppendDataBoundItems="True">
                    <asp:ListItem Value="0">Selecione um Album</asp:ListItem>
                </asp:DropDownList>
                <asp:ObjectDataSource ID="odsAlbum" runat="server" 
                    DataObjectTypeName="Negocios.Album" InsertMethod="Insere" 
                    OldValuesParameterFormatString="original_{0}" SelectMethod="ConsultaTodos" 
                    TypeName="Negocios.AlbumBLL"></asp:ObjectDataSource>
            </td>
        </tr>
        <tr>
            <td style="width: 83px">
                <asp:Label ID="lbFormato" runat="server" Text="Formato"></asp:Label>
            </td>
            <td>
                <asp:DropDownList ID="ddFormato" runat="server" DataSourceID="odsFormato" 
                    DataTextField="Nome" DataValueField="Codigo" AppendDataBoundItems="True">
                    <asp:ListItem Selected="True" Value="0">Selecione um Formato</asp:ListItem>
                </asp:DropDownList>
                <asp:ObjectDataSource ID="odsFormato" runat="server" 
                    DataObjectTypeName="Negocios.Formato" DeleteMethod="Remove" 
                    InsertMethod="Insere" OldValuesParameterFormatString="original_{0}" 
                    SelectMethod="ConsultaTodos" TypeName="Negocios.FormatoBLL" 
                    UpdateMethod="Atualiza"></asp:ObjectDataSource>
            </td>
        </tr>
        <tr>
            <td style="width: 83px">
               
                <asp:Button ID="btConsultar" runat="server" Text="Consultar" 
                    onclick="btConsultar_Click" />
                
            </td>
            <td>
                
                <br />
                
            </td>
        </tr>
    </table>
    <div class="collapsePanelHeader" style="width: 400px; height: 15px">
    </div>
    <asp:GridView ID="gvMostrarArquivos" runat="server" AutoGenerateColumns="False" 
        DataSourceID="odsConsultaPorFiltro">
        <Columns>
            <asp:BoundField DataField="Nome" HeaderText="Nome" 
                SortExpression="Nome" />
            <asp:BoundField DataField="Localizacao" HeaderText="Localizacao" 
                SortExpression="Localizacao" />
            <asp:BoundField DataField="Codigo" HeaderText="Codigo" 
                SortExpression="Codigo" />
        </Columns>
    </asp:GridView>
    <asp:ObjectDataSource ID="odsConsultaPorFiltro" runat="server" 
        DataObjectTypeName="Negocios.Audio" DeleteMethod="Remove" InsertMethod="Insere" 
        OldValuesParameterFormatString="original_{0}" SelectMethod="ConsultaPorFiltro" 
        TypeName="Negocios.AudioBLL" UpdateMethod="Atualiza">
        <SelectParameters>
            <asp:ControlParameter ControlID="tbNome" DefaultValue="" Name="nome" 
                PropertyName="Text" Type="String" />
            <asp:ControlParameter ControlID="ddGenero" DefaultValue="0" Name="genero" 
                PropertyName="SelectedValue" Type="Int32" />
            <asp:ControlParameter ControlID="ddAutor" DefaultValue="0" Name="autor" 
                PropertyName="SelectedValue" Type="String" />
            <asp:ControlParameter ControlID="ddAubum" DefaultValue="0" Name="album" 
                PropertyName="SelectedValue" Type="String" />
            <asp:ControlParameter ControlID="ddFormato" DefaultValue="0" Name="formato" 
                PropertyName="SelectedValue" Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:Label ID="lbErro" runat="server" CssClass="erro"></asp:Label>
</asp:Content>

